<template>
  <div class="layout-page">

    <!-- 标签栏支持路由模式，用于搭配 vue-router 使用.
    路由模式下会匹配页面路径和标签的 to 属性，并自动选中对应的标签 -->
    <van-tabbar
      v-model="active"
      route
      active-color="#ee0a24"
      inactive-color="#000"
    >
      <van-tabbar-item icon="home-o" to="/article">面经</van-tabbar-item>
      <van-tabbar-item icon="search" to="/collect">收藏</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/like">喜欢</van-tabbar-item>
      <van-tabbar-item icon="setting-o" to="/user">我的</van-tabbar-item>
    </van-tabbar>
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'layout-page',
  data () {
    return {
      active: 0
    }
  }
}
</script>

<style lang="less" scoped></style>
